package cn.tedu.dictionary.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class ListQueueService {
    @Autowired
    private RedisTemplate redisTemplate;
    /**入队操作*/
    public void enqueue(String key, Object value) {
        redisTemplate.opsForList().leftPush(key, value);
    }
    /**出队操作*/
    public Object dequeue(String key) {
        return redisTemplate.opsForList().rightPop(key);
    }
}
